package dmir.reaction.publico.graph.communities;

public class Overlap {
	
	Community D = new Community();
	Community E = new Community();
	Float overlap;
	String time_span = null;
	
	public Overlap(Community d, Community e, Float overlap) {
		super();
		D = d;
		E = e;
		this.overlap = overlap;
	}
	
	@Override
	public String toString(){
		return "D: " + D.clique + '\t' + "E: " + E.clique +'\t' + "overlap: " + this.overlap;
		
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((D == null) ? 0 : D.hashCode());
		result = prime * result + ((E == null) ? 0 : E.hashCode());
		result = prime * result + ((overlap == null) ? 0 : overlap.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Overlap other = (Overlap) obj;
		if (D == null) {
			if (other.D != null)
				return false;
		} else if (!D.equals(other.D))
			return false;
		if (E == null) {
			if (other.E != null)
				return false;
		} else if (!E.equals(other.E))
			return false;
		if (overlap == null) {
			if (other.overlap != null)
				return false;
		} else if (!overlap.equals(other.overlap))
			return false;
		return true;
	}
	
}